<template>
    <div class="index">
        <pc>
            <qHeader></qHeader>
            <el-container>
            </el-container>
            <div class="foot"></div>
        </pc>
    </div>
</template>
<script>
// 引入组件
import pc from "@/components/cockpit/pc.vue";
import qHeader from "@/components/cockpit/header.vue";
export default {
    data() {
        return {
        }
    },
    methods: {
        handleServe() {
            realTimeData({
                "currentPage": 1,
                "pageSize": 100,
                "searchVal": "string"
            }).then((res) => {
                console.log(res);
            })
        },

        // handleBack(){
        //     console.log("1111111111");

        // }
        // 自动全屏
        fullscreenCheck() {
            if (!document.fullscreenElement &&
                !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {  // current working methods
                if (document.documentElement.requestFullscreen) {
                    document.documentElement.requestFullscreen();
                } else if (document.documentElement.msRequestFullscreen) {
                    document.documentElement.msRequestFullscreen();
                } else if (document.documentElement.mozRequestFullScreen) {
                    document.documentElement.mozRequestFullScreen();
                } else if (document.documentElement.webkitRequestFullscreen) {
                    document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
                }
            } else {
                if (document.exitFullscreen) {
                    document.exitFullscreen();
                } else if (document.msExitFullscreen) {
                    document.msExitFullscreen();
                } else if (document.mozCancelFullScreen) {
                    document.mozCancelFullScreen();
                } else if (document.webkitExitFullscreen) {
                    document.webkitExitFullscreen();
                }
            }
        }
    },
    mounted() {
        // this.handleServe()

        // 自动全屏
        this.fullscreenCheck()

        // 抬起esc退出
        this.$nextTick(() => {
            document.onkeyup = (e) => {
                // console.log(e);
                //此处填写你的业务逻辑即可
                if (e.key == "Escape") {
                    this.$router.back()
                }
            }
        })

    },
    // 注册组件
    components: {
        pc,
        qHeader,
    },
}
</script>
<style lang="less" scoped>
.index::v-deep {
    background-color: #051C55;
    position: fixed;
    right: 0;
    top: 0;
    left: 0;
    bottom: 0;

    // width: 1920px;
    // height: 1080px;

    .el-container {
        height: 100%;
        overflow: hidden;

        .el-row {
            width: 100%;
            display: flex;

            .el-col {
                &:nth-child(1) {
                    width: 525px;
                    margin: 0 30px 0 38px;
                }

                &:nth-child(2) {
                    width: 735px;
                }

                &:nth-child(3) {
                    width: 525px;
                    margin: 0 42px 0 22px;
                }
            }

        }
    }

    .foot {
        width: 100%;
        height: 25px;
        background-image: url(@/assets/images/cockpit/foot.png);
        background-size: contain;
        background-repeat: no-repeat;
        position: fixed;
        bottom: 0;
    }
}</style>